package cn.dtsmusic;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.context.annotation.Bean;

import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;

import lombok.extern.slf4j.Slf4j;

/**
 * SpringBoot 启动类
 *
 * @author leobelive
 */
@SpringBootApplication
@MapperScan("cn.dtsmusic.mapper")
@Slf4j
public class Application  {

	private static Log log = LogFactory.getLog(Application.class );
	
    public static void main(String[] args) {
        System.setProperty("druid.logType", "slf4j");
        SpringApplication.run(Application.class, args);
        log.info("系统成功 启动,正在 运行 ...");
    }
    
    @Bean
    public HttpMessageConverters fastJsonHttpMessageConverters(){
    	FastJsonHttpMessageConverter convert = new FastJsonHttpMessageConverter();
    	FastJsonConfig config = new FastJsonConfig();
    	config.setSerializerFeatures(SerializerFeature.PrettyFormat);
    	convert.setFastJsonConfig(config);
    	return new HttpMessageConverters(convert);
    }

}